package com.fs.common.pojo;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fs.common.annotation.ColumnDesc;
import com.fs.common.annotation.Formula;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author ACE
 * @desc 日志实体类
 * @creationTime 2019-03-30 15:00
 * @projectName weixinframe
 * @packageName com.fs.pojo
 */
@Data
@AllArgsConstructor
@TableName("s_log")
@EqualsAndHashCode(callSuper=false)
public class Log extends IdEntity{
	@ColumnDesc(name="企业ID")
	private String comId;

	@ColumnDesc(name = "企业名称")
	@TableField(exist = false,fill = FieldFill.DEFAULT)
	@Formula(sql = "(select c.company_name from s_company c where c.id = com_id)")
	private String companyName;

	@ColumnDesc(name = "昵称")
	@TableField(exist = false,fill = FieldFill.DEFAULT)
	@Formula(sql = "(select c.nick_name from s_user c where c.id = creater_id)")
	private String nickName;

	@ColumnDesc(name="请求ip地址")
	private String ip;

	@ColumnDesc(name="模块名称")
	private String modular;

	@ColumnDesc(name="超作类型")
	private String type;

	@ColumnDesc(name="备注")
	private String remark;

	public Log() {
	}

	public Log(String comId, String ip, String modular, String type,
                String remark, String createrId) {
		super();
		this.createrId = createrId;
		this.comId = comId;
		this.ip = ip;
		this.modular = modular;
		this.type = type;
		this.remark = remark;
	}


}
